import { noAuthRouters } from "./config";
import { handlerUrl } from "./handlerLaunch";
let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
list.forEach((item) => {
    //用遍历的方式分别为,uni.navigateTo,uni.redirectTo,uni.reLaunch,uni.switchTab这4个路由方法添加拦截器
    console.log(item, "router list item");
    uni.addInterceptor(item, {
        invoke(e) {
            // 调用前拦截
            console.log(e, "|-调用前拦截,routerjs invoke");
            const url = e.url.split("?")[0];
            return handlerUrl(url);
        },
        fail(err) {
            // 失败回调拦截
            console.log(err);
        },
    });
});
